<!--
  Created by IntelliJ IDEA.
  UserManage: Dai
  Date: 2018/3/26
  Time: 16:13
  Remark: 系统监控内嵌页面-楼宇级(不启用装饰器)
  To change this template use File | Settings | File Templates.
-->
<!DOCTYPE html>
<html lang="en" layout:decorate="~{default/just_css_and_js}" xmlns:layout="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <link href="/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
    <style>
        /*加红加粗的字*/
        .red_and_bold {
            color: red;
            font-weight: bolder;
        }

        /*带圈的数字的样式*/
        .circle_for_number {
            width: 20px;
            height: 20px;
            background-color: red;
            border-radius: 25px;
            float: left;
            margin-right: 10px
        }

        .number_in_circle {
            height: 13px;
            line-height: 20px;
            display: block;
            color: #FFF;
            text-align: center
        }

        /*这个页面上的表格的样式*/
        .th-inner {
            height: 20px;
            line-height: 20px;
            font-size: 13px;
            padding: 0 !important;
            /* background-image: none; */
            background-color: white;
            border: 0 !important;
        }

        table {
            border: 0 !important;
        }

        tr {
            border: 0 !important;
        }

        /*实时监控 实时概况*/
        fieldset.col-xs-7 span.col-sm-2 {
            padding: 5px 0 0 5px;
        }

        fieldset.col-xs-7 span.col-sm-2 span.col-sm-8 {
            padding: 0;
        }

        /*实时监控 电池包总览 行转列只能用div做了*/
        .div-like-form .div-left div { /*每一列的div的属性*/
            padding: 5px 15px;
        }

        .div-like-form .div-left { /*每一列的属性*/
            float: left;
            text-align: center;
        }

        .div-like-form .div-left .name { /*名称栏变成灰色*/
            background-color: #c2c2c2;
        }

        .div-like-form .div-left:first-child div { /*首列属性名称*/
            padding: 5px 60px;
        }

        .div-like-form .div-left img { /*首行图片格式*/
            max-height: 50px;
            margin: 5px auto
        }

    </style>
    <script src="/js/echarts.min.js"></script>
    <!-- datepicker 时间选择器 -->
    <script src="/js/bootstrap-datetimepicker.min.js"></script>
    <script src="/js/bootstrap-datetimepicker.zh-CN.js"></script>
    <script>
        /**
         * 限制开始时间和结束时间不能互相超过
         */
        $(function () {
            $("#start_time_select").datetimepicker({
                bootcssVer: 3,   //设置读取bootstrap3，否则默认读取bootstrap2，左右箭头会不见
                startView: 2,
                format: "yyyy-mm-dd",
                minView: "month",
                todayBtn: "linked",
                todayHighlight: true,
                language: "zh-CN",
                showMeridian: true,
                autoclose: true,
                endDate: new Date()
            }).on('changeDate', function (ev) {
                var starttime = $("#start_time_select").val();
                $("#end_time_select").datetimepicker('setStartDate', starttime);
                change_data_type_of_date();
            });

            $("#end_time_select").datetimepicker({
                bootcssVer: 3,   //设置读取bootstrap3，否则默认读取bootstrap2，左右箭头会不见
                startView: 2,
                format: "yyyy-mm-dd",
                minView: "month",
                todayBtn: "linked",
                todayHighlight: true,
                language: "zh-CN",
                autoclose: true,
                showMeridian: true,
                endDate: new Date()
            }).on('changeDate', function (ev) {
                var endtime = $("#end_time_select").val();
                $("#start_time_select").datetimepicker('setEndDate', endtime);
                change_data_type_of_date();
            });

            $("#system_start_time").datetimepicker({
                bootcssVer: 3,   //设置读取bootstrap3，否则默认读取bootstrap2，左右箭头会不见
                startView: 2,
                format: "yyyy-mm-dd",
                minView: "month",
                todayBtn: "linked",
                todayHighlight: true,
                language: "zh-CN",
                autoclose: true,
                showMeridian: true
            })
        });

        /**
         * 根据自定义的天数决定是否显示小时
         */
        function change_data_type_of_date() {
            var starttime = $("#start_time_select").val();
            var endtime = $("#end_time_select").val();
            $("#data_freque").empty();
            var str = "";
            var cha = GetDateDiff(starttime, endtime);
            console.log(cha);
            if (cha > 8) {
                str = '<button type="button" class="btn btn-choose-red active">日</button>';
            } else {
                str = '<button type="button" class="btn btn-choose-red active">日</button><button type="button" class="btn btn-choose-red">小时</button>';
            }
            $("#data_freque").prepend(str);
            change_data_type($(this));
            $('#data_freque button').click(function (e) {
                change_data_type($(this));
            });
        }

        /**
         * 计算两个日期之间的相距天数
         */
        function GetDateDiff(starttime, endtime) {
            var startTime = new Date(Date.parse(starttime.replace(/-/g, "/"))).getTime();
            var endTime = new Date(Date.parse(endtime.replace(/-/g, "/"))).getTime();
            var dates = Math.abs((startTime - endTime)) / (1000 * 60 * 60 * 24);
            return dates;
        }
    </script>
    <!--定死数据的js-->
    <script>
        /**
         * 历史查询中的button
         */
        var str_1 =
            '<button type="button" class="btn btn-choose-red active">replace_this</button>';
        var str_other =
            '<button type="button" class="btn btn-choose-red">replace_this</button>';

        /**
         * 点击切换tab页面
         */
        function changeTab(e) {
            // 1. 切换活跃状态
            $(e).parent().siblings().removeClass("active");
            $(e).parent().addClass("active");
            // 2. 根据id显示页面
            var id = $(e).attr("id").replace("title", "step");
            $("#" + id).siblings().hide();
            $("#" + id).show();
        }

        /**
         * 故障信息 中的 详细
         */
        function goToDetailPage() {
            // TODO 跳转到 报警管理 > 大厦名称 的页面
        }

        /**
         * 实时数据 中的 故障信息 中的 表格的table字段格式
         */
        var error_data_format = [
            {
                title: "",
                formatter: function (value, row, index) {
                    return index + 1; // 第一行自然排序
                }
            },
            {
                field: 'name',
                title: '设备'
            },
            {
                field: 'error_name',
                title: '故障名称'
            },
            {
                field: 'error_type',
                title: '故障类型'
            },
            {
                field: 'time',
                title: '发生时间',
                formatter: function (value, row, index) {
                    return formatTimeStrap(value);
                }
            }
        ];
        /**
         * 台账信息 中的 分时电价表 中的 表格的table字段格式
         */
        var tuo_electricity_pricing_format = [
            {
                field: 'time_name',
                title: '时段名称'
            },
            {
                field: 'time',
                title: '时间'
            },
            {
                field: 'price',
                title: '电价(元/kWh)'
            }
        ];
        /**
         * 初始化table
         */
        window.onload = function () {
            $("#error_data").bootstrapTable({
                queryParamsType: "undefined",
                columns: error_data_format,
                url: "/monitor/error_data"
            });
            $("#tuo_electricity_pricing").bootstrapTable({
                queryParamsType: "undefined",
                columns: tuo_electricity_pricing_format,
                url: "/monitor/tou_electricity_pricing"
            });
        };

        /**
         * 图表
         */
        $(function () {
            /**
             * 实时监控 中的 今日充放电量、电费曲线
             */
            show_today_electricity();
            /**
             * 实时监控 电池包总览 柱状图
             */
            show_package_info();
            /**
             * 历史数据中的图表
             */
            echarts.init(document.getElementById('search_history')).setOption({
                title: {                // 标题
                    left: 'center',
                    top: '3%',
                    text: '大拇指商业广场 <2017-11-14~2017-11-14> 充电量'
                },
                grid: {                 // 设置边距
                    left: '0%',
                    right: '3%',
                    bottom: '10%',
                    containLabel: true  // 是否包含显示的刻度
                },
                tooltip: {              // 提示框组件
                    trigger: 'axis'     // 触发类型 axis坐标轴触发
                },
                legend: {               // 图例
                    data: ['A相电流', 'B相电流', 'C相电流'],
                    x: 'center',        //中间
                    y: 'bottom'         //下方
                },
                toolbox: {              // 工具栏
                    show: true,
                    top: '3%',
                    feature: {
                        dataView: {readOnly: false},        //数据视图
                        magicType: {type: ['line', 'bar']}, //变换类型
                        restore: {},                        //刷新
                        saveAsImage: {}                     //保存图片
                    }
                },
                xAxis: {                // x轴
                    type: 'category',
                    boundaryGap: false,  //坐标轴两边留白，如果是false就是0点在y轴上
                    data: ['09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00']
                },
                yAxis: [
                    {
                        name: '单位(A)',
                        type: 'value',
                        boundaryGap: true,
                        // min: 0,
                        max: function (value) {
                            return value.max + 100;
                        }
                    }
                ],
                series: [
                    {
                        name: 'A相电流',
                        type: 'line',
                        data: [200, 220, 223.5, 300, 395.6, 654.2, 824.3, 725.4, 542.8]
                    },
                    {
                        name: 'B相电流',
                        type: 'line',
                        data: [212.3, 234, 263.5, 350.8, 365.6, 674.2, 854.3, 715.4, 562.8]
                    },
                    {
                        name: 'C相电流',
                        type: 'line',
                        data: [232.3, 222, 243.5, 330.8, 368.6, 634.2, 894.3, 765.4, 512.8]
                    }
                ]
            });
        });
        /**
         * 实时监控 中的 今日充放电量、电费曲线
         */
        function show_today_electricity(){
            var today_electricity = echarts.init(document.getElementById('today_electricity'));
            today_electricity.setOption({
                title: {                // 标题
                    left: 'center',
                    text: '今日充放电量、电费曲线'
                },
                grid: {                 // 设置边距
                    left: '0%',
                    right: '0%',
                    bottom: '10%',
                    containLabel: true  // 是否包含显示的刻度
                },
                tooltip: {              // 提示框组件
                    trigger: 'axis'     // 触发类型 axis坐标轴触发
                },
                legend: {               // 图例
                    data: [],
                    x: 'center',
                    y: 'bottom'
                },
                toolbox: {              // 工具栏
                    show: true,
                    feature: {
                        dataView: {readOnly: false},        //数据视图
                        magicType: {type: ['line', 'bar']}, //变换类型
                        restore: {},                        //刷新
                        saveAsImage: {}                     //保存图片
                    }
                },
                xAxis: {                // x轴
                    type: 'category',
                    boundaryGap: true,  //坐标轴两边留白，如果是false就是0点在y轴上
                    data: []
                },
                yAxis: [
                    {
                        name: '单位(kWh)',
                        type: 'value',
                        boundaryGap: false,  // 坐标轴两边留白，如果是false就是0点在y轴上
                        min: 0,
                        max: function (value) {
                            return value.max + 15000;
                        }
                    },
                    {
                        name: '节省电量：元',
                        type: 'value',
                        min: function (value) {
                            return value.min - 1000;
                        },
                        max: function (value) {
                            return value.max + 1000;
                        },
                        splitLine: {        // 刻度线
                            show: false     // 是否显示刻度线
                        }
                    }
                ],
                series: []
            });
            today_electricity.showLoading();
            $.get('/monitor/today_electricity').done(function (data) {
                today_electricity.hideLoading();
                // 填入数据
                today_electricity.setOption({
                    legend: {
                        data: data.names
                    },
                    xAxis: {
                        data: data.times
                    },
                    series: data.lines
                });
            });
        }
        /**
         * 实时监控 电池包总览 柱状图
         */
        function show_package_info(){
            var package_info = echarts.init(document.getElementById('package_info'));
            package_info.setOption({
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                        type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                    },
                    formatter: function (params) {
                        var length = params.length;
                        var str = params[0].name + "<br>";
                        str += params[0].seriesName + ":&nbsp;" + params[0].value + "<br>";
                        str += "单体电压最高(V):&nbsp;" + (params[0].value + params[1].value) + "<br>";
                        str += params[1].seriesName + ":&nbsp;" + params[1].value + "<br>";
                        str += params[2].seriesName + ":&nbsp;" + params[2].value + "<br>";
                        str += "单体温度最高(℃):&nbsp;" + (params[2].value + params[3].value) + "<br>";
                        str += params[3].seriesName + ":&nbsp;" + params[3].value + "<br>";
                        return str;
                    }
                },
                grid: {
                    left: '13.5%',
                    right: '0%',
                    bottom: '3%',
                    top: '0%',
                    containLabel: true
                },
                xAxis: [
                    {
                        show: false,
                        type: 'category',
                        data: []
                    }
                ],
                yAxis: [
                    {
                        show: false,
                        type: 'value',
                        splitLine: {    //不显示坐标辅助线
                            show: false
                        }
                    }
                ],
                series: [
                ]
            });
            package_info.showLoading();
            $.get('/monitor/package_info').done(function (data) {
                package_info.hideLoading();
                package_info.setOption({
                    xAxis:[
                        {
                            data: data.times
                        }
                    ],
                    series: data.lines
                });
            });
        }

        /**
         * 初始化页面
         */
        $(function () {
            /**
             * 除了第一个其他的页面都不显示
             */
            $("#default-step-0").show().siblings().hide();
            $("#time_select").hide();
            /**
             * 按钮点击事件
             */
            button_click();
            /**
             * 更改 实时监控 电池包总览 的 宽度
             */
            change_model_monitor_div_width();
            /**
             * 绑定台账信息的修改页面的input框的样式修改
             */
            input_on_focus();
        });

        /**
         * 更改 实时监控 电池包总览 的 宽度
         */
        function change_model_monitor_div_width() {
            var father_width = $(".div-like-form").width();
            var first_width = $(".div-left").width();
            var size = $(".div-like-form .div-left").size();
            var width = (father_width - first_width) / (size - 1) - 1;
            $(".div-like-form .div-left").each(function (index) {
                if (index != 0) {
                    $(this).css("width", width);
                }
            });
        }

        /**
         * 按钮点击事件
         */
        function button_click() {
            /**
             * 测点类型
             */
            $('#test_type button').click(function (e) {
                change_test_name($(this))
            });
            /**
             * 测点名称
             */
            $('#test_name button').click(function (e) {
                $(this).addClass('active').siblings().removeClass('active');
            });
            /**
             * 时间范围
             */
            $('#time_ranges button').click(function (e) {
                change_data_freque($(this));
            });
            /**
             * 显示密度
             */
            $('#data_freque button').click(function (e) {
                change_data_type($(this));
            });
            /**
             * 显示类别
             */
            $('#data_type button').click(function (e) {
                $(this).addClass('active').siblings().removeClass('active');
            });
        }

        /**
         * 当测点类型改变时，改变对应的测点名称
         */
        function change_test_name(button) {
            $(button).addClass('active').siblings().removeClass('active');
            var text = $(button).text();
            $("#test_name").empty();
            var str = "";
            switch (text) {
                case "能量":
                    str = str_1.replace("replace_this", "当天充电量") + str_other.replace("replace_this", "当天放电量") + str_other.replace("replace_this", "总放电量") + str_other.replace("replace_this", "总充电量(多选)");
                    break;
                case "电费":
                    str = str_1.replace("replace_this", "AB线电压") + str_other.replace("replace_this", "BC线电压") + str_other.replace("replace_this", "CA线电压") + str_other.replace("replace_this", "直流母线电压(多选)");
                    break;
                case "效率":
                    str = str_1.replace("replace_this", "A相电流") + str_other.replace("replace_this", "B相电流") + str_other.replace("replace_this", "C相电流") + str_other.replace("replace_this", "直流母线电流(多选)");
                    break;
            }
            $("#test_name").prepend(str);
            $('#test_name button').click(function (e) {
                $(this).addClass('active').siblings().removeClass('active');
            });
        }

        /**
         * 当时间范围变化时，变化显示密度
         */
        function change_data_freque(button) {
            $(button).addClass('active').siblings().removeClass('active');
            var text = $(button).text();
            $("#data_freque").empty();
            var str = "";
            switch (text) {
                case "日":
                    str = str_1.replace("replace_this", "小时") + str_other.replace("replace_this", "15分钟");
                    $("#time_select").hide();
                    break;
                case "周":
                    str = str_1.replace("replace_this", "日") + str_other.replace("replace_this", "小时");
                    $("#time_select").hide();
                    break;
                case "月":
                    str = str_1.replace("replace_this", "日");
                    $("#time_select").hide();
                    break;
                case "年":
                    str = str_1.replace("replace_this", "月");
                    $("#time_select").hide();
                    break;
                case "自定义":
                    str = str_1.replace("replace_this", "日") + str_other.replace("replace_this", "小时");
                    $("#time_select").show();
                    break;
            }
            $("#data_freque").prepend(str);
            change_data_type($(this));
            $('#data_freque button').click(function (e) {
                change_data_type($(this));
            });
        }

        /**
         * 当显示密度变化时，变化显示类别
         */
        function change_data_type(button) {
            $(button).addClass('active').siblings().removeClass('active');
            var text = $(button).text();
            if (text == '15分钟') {
                $("#data_type").empty();
                $("#data_type").prepend(str_1.replace("replace_this", "瞬态值"));
            } else {
                if ($("#data_type").children().size() != 3) {
                    var str = str_1.replace("replace_this", "平均值") + str_other.replace("replace_this", "最大值") + str_other.replace("replace_this", "最小值");
                    $("#data_type").empty();
                    $("#data_type").prepend(str);
                }
            }
            /**
             * 显示类别
             */
            $('#data_type button').click(function (e) {
                $(this).addClass('active').siblings().removeClass('active');
            });
        }

        /**
         * 绑定台账信息的修改页面的input框的样式修改
         */
        function input_on_focus(){
            $("#save_change").hide();
            $("#default-step-2").find("input").on("click", function () {
                $("#default-step-2").find("input").css({
                    "border":"1px solid #b5b5b5",
                    "padding":"6px",
                    "margin-top": "3px",
                    "margin-bottom": "3px",
                });
            });
            $("#default-step-2").find("input").on("change", function () {
                $("#save_change").show();
            });
        }
    </script>
    <!--刷新操作的js-->
    <script>
        /**
         * 根据id刷新可储蓄电量
         */
        function refresh_could_saving_electricity() {
            var id = $("id").val();
            $.post("/monitor/refresh_could_saving_electricity", {id: id}, function (data) {
                $("#could_saving_electricity").text(data);
            });
        }

        /**
         * 根据id刷新总容量
         */
        function refresh_total_electricity() {
            var id = $("id").val();
            $.post("/monitor/refresh_total_electricity", {id: id}, function (data) {
                $("#total_electricity").text(data);
            });
        }
    </script>
</head>
<body>
<div layout:fragment="content">
    <div class="main-content-inner">
        <input type="hidden" id="id" th:value="${id}">
        <!--面包屑导航栏-->
        <ul class="breadcrumb">
            <li>
                <a href="#">系统监控</a>
            </li>
            <li class="active" th:text="${name}"></li>
        </ul>
        <!-- 标题tab -->
        <ul class="nav nav-tabs">
            <li role="presentation" class="active"><a href="#" onclick="changeTab(this)" id="default-title-0">实时数据</a>
            </li>
            <li role="presentation"><a href="#" onclick="changeTab(this)" id="default-title-1">历史数据</a></li>
            <li role="presentation"><a href="#" onclick="changeTab(this)" id="default-title-2">设备台帐</a></li>
        </ul>
        <!-- 内容显示 -->
        <div>
            <!--实时监控-->
            <form id="default-step-0" class="container-fluid">
                <!--实施概况-->
                <fieldset class="col-xs-7" style="margin-right: 10px;">
                    <legend>实时概况</legend>
                    <div style="margin-top: 10px;float: left;width: 50%">
                        <label class="col-sm-4" style="padding-left: 5px">可储蓄电量:</label>
                        <label class="col-sm-6">
                            <span class="col-sm-8" th:text="${monitorData.could_saving_electricity}"
                                  id="could_saving_electricity"></span>kW
                        </label>
                        <button type="button" style="background: white; color: black; border: 0;"
                                onclick="refresh_could_saving_electricity()">
                            <i class="glyphicon glyphicon-refresh"></i>
                        </button>
                    </div>
                    <div style="margin-top: 10px;float: left;width: 50%">
                        <label class="col-sm-4" style="padding-left: 5px">总容量:</label>
                        <label class="col-sm-6">
                            <span class="col-sm-8" th:text="${monitorData.total_electricity}"
                                  id="total_electricity"></span>Ah
                        </label>
                        <button type="button" style="background: white; color: black; border: 0;"
                                onclick="refresh_total_electricity()">
                            <i class="glyphicon glyphicon-refresh"></i>
                        </button>
                    </div>
                    <span class="col-sm-2">累计充电量:</span>
                    <span class="col-sm-2">
                        <span class="col-sm-8" th:text="${monitorData.grand_total_input_capacity}"></span>kWh
                    </span>
                    <span class="col-sm-2">今日充电量:</span>
                    <span class="col-sm-2"><span class="col-sm-8" th:text="${monitorData.today_input_capacity}"></span>kWh</span>
                    <span class="col-sm-2">安全运行天数:</span>
                    <span class="col-sm-2"><span class="col-sm-8" th:text="${monitorData.safe_operation_days}"></span>天</span>
                    <span class="col-sm-2">累计放电量:</span>
                    <span class="col-sm-2">
                        <span class="col-sm-8" th:text="${monitorData.grand_total_output_capacity}"></span>kWh
                    </span>
                    <span class="col-sm-2">今日放电量:</span>
                    <span class="col-sm-2"><span class="col-sm-8" th:text="${monitorData.today_output_capacity}"></span>kWh</span>
                    <span class="col-sm-2">系统效率:</span>
                    <span class="red_and_bold col-sm-2">
                        <span class="col-sm-8" th:text="${monitorData.system_efficiency}"></span>%
                    </span>
                    <span class="col-sm-2">累计节省电费:</span>
                    <span class="red_and_bold col-sm-2">
                        <span class="col-sm-8" th:text="${monitorData.grand_total_save_electricity_cost}"></span>元
                    </span>
                    <span class="col-sm-2">今日节省电费:</span>
                    <span class="red_and_bold col-sm-2">
                        <span class="col-sm-8" th:text="${monitorData.today_save_electricity_cost}"></span>元
                    </span>
                </fieldset>
                <!--故障信息-->
                <fieldset>
                    <legend>故障信息</legend>
                    <div class="col-sm-2" style="width: 22%">
                        <div class="circle_for_number">
                            <span class="number_in_circle">0</span>
                        </div>
                        四级
                    </div>
                    <div class="col-sm-2" style="width: 22%">
                        <div class="circle_for_number" style="background-color: #CC9966">
                            <span class="number_in_circle">0</span>
                        </div>
                        三级
                    </div>
                    <div class="col-sm-2" style="width: 22%">
                        <div class="circle_for_number" style="background-color: #3300FF">
                            <span class="number_in_circle">0</span>
                        </div>
                        二级
                    </div>
                    <div class="col-sm-2" style="width: 22%">
                        <div class="circle_for_number" style="background-color: #33CCFF">
                            <span class="number_in_circle">0</span>
                        </div>
                        一级
                    </div>
                    <a href="javascript:;" onclick="goToDetailPage()">详细</a>
                    <div style="margin-top: 10px;overflow-x: hidden;height: 80px;">
                        <table id="error_data" class="table table-condensed">
                        </table>
                    </div>
                </fieldset>
                <!--今日放电量、电费曲线-->
                <div id="today_electricity" style="width: 100%;height:300px;margin-top: 10px"></div>
                <!--电池包总览-->
                <fieldset>
                    <legend>电池包总览</legend>
                    <!--表格-->
                    <div class="div-like-form" style="width: 100%; height: 180px">
                        <div class="div-left">
                            <div style="height: 60px;"></div>
                            <div>&nbsp;</div>
                            <div>电压(V)</div>
                            <div>电流(A)</div>
                            <div>SOC(%)</div>
                        </div>
                        <!--TODO 下面用foreach来做 但是要注意的是width是要改变的 才能均匀-->
                        <div class="div-left" th:each="package:${packageInfo}">
                            <img src="/image/package-success.png">
                            <div class="name" th:text="${package.name}">1#模组</div>
                            <div th:text="${package.voltage}"></div>
                            <div th:text="${package.electric_current}"></div>
                            <div th:text="${package.soc}"></div>
                        </div>
                    </div>
                    <!--柱状图-->
                    <div id="package_info" style="height: 200px; "></div>
                    <div style="position:absolute; top:800px; left:30px; z-index:100 ">
                        <p style="color: red">单体电压极值和极差(V)</p>
                        <p style="color: blue">单体温度极值和极差(℃)</p>
                    </div>
                </fieldset>
            </form>
            <!--历史查询-->
            <div id="default-step-1">
                <form style="margin-top: 10px" class="col-sm-12">
                    <div>
                        <label style="margin-right: 15px">测点类别</label>
                        <div id="test_type" class="btn-group btn-group-sm">
                            <button type="button" class="btn btn-choose-red active">能量</button>
                            <button type="button" class="btn btn-choose-red">电费</button>
                            <button type="button" class="btn btn-choose-red">效率</button>
                        </div>
                    </div>
                    <div>
                        <label style="margin-right: 15px">测点名称</label>
                        <div id="test_name" class="btn-group btn-group-sm">
                            <button type="button" class="btn btn-choose-red active">当天充电量</button>
                            <button type="button" class="btn btn-choose-red">当天放电量</button>
                            <button type="button" class="btn btn-choose-red">总放电量</button>
                            <button type="button" class="btn btn-choose-red">总充电量(多选)</button>
                        </div>
                    </div>
                    <div>
                        <label style="margin-right: 15px">时间范围</label>
                        <div id="time_ranges" class="btn-group btn-group-sm">
                            <button type="button" class="btn btn-choose-red active">日</button>
                            <button type="button" class="btn btn-choose-red">周</button>
                            <button type="button" class="btn btn-choose-red">月</button>
                            <button type="button" class="btn btn-choose-red">年</button>
                            <button type="button" class="btn btn-choose-red">自定义</button>
                            <div style="display: inline-block" id="time_select">
                                <input class="form_date"
                                       style="height: 30px; background-color: white !important; border-radius: 5px !important"
                                       type="text" placeholder="开始时间"
                                       id="start_time_select" data-link-field="start_time" data-link-format="yyyy-mm-dd"
                                       readonly>
                                <span>至</span>
                                <input class="form_date"
                                       style="height: 30px; background-color: white !important; border-radius: 5px !important"
                                       type="text" placeholder="结束时间"
                                       id="end_time_select" data-link-field="end_time" data-link-format="yyyy-mm-dd"
                                       readonly>
                                <input type="hidden" id="start_time" name="start_time">
                                <input type="hidden" id="end_time" name="end_time">
                            </div>
                        </div>
                    </div>
                    <div>
                        <label style="margin-right: 15px">显示密度</label>
                        <div id="data_freque" class="btn-group btn-group-sm">
                            <button type="button" class="btn btn-choose-red active">小时</button>
                            <button type="button" class="btn btn-choose-red">15分钟</button>
                        </div>
                    </div>
                    <div>
                        <label style="margin-right: 15px">显示类别</label>
                        <div id="data_type" class="btn-group btn-group-sm">
                            <button type="button" class="btn btn-choose-red active">平均值</button>
                            <button type="button" class="btn btn-choose-red">最小值</button>
                            <button type="button" class="btn btn-choose-red">最大值</button>
                        </div>
                    </div>
                </form>
                <div id="search_history" class="col-sm-12"
                     style="height: 400px; margin-top: 10px; border-top: 1px solid #C5D0DC;"></div>
            </div>
            <!--台帐信息-->
            <form id="default-step-2" class="container-fluid">
                <!--项目信息-->
                <fieldset class="col-xs-6" style="margin-right: 10px;">
                    <legend>项目信息</legend>
                    <!--地址-->
                    <div class="col-sm-12">
                        <label class="col-sm-4" style="text-align: right;">地址</label>
                        <input type="text" th:value="${projectData.address}">
                    </div>
                    <!--联系人-->
                    <div class="col-sm-12">
                        <label class="col-sm-4" style="text-align: right;">联系人</label>
                        <input type="text" th:value="${projectData.contacts}">
                    </div>
                    <!--联系电话-->
                    <div class="col-sm-12">
                        <label class="col-sm-4" style="text-align: right;">联系电话</label>
                        <input type="text" th:value="${projectData.tel}">
                    </div>
                    <!--系统上线时间-->
                    <div class="col-sm-12">
                        <label class="col-sm-4" style="text-align: right;">系统上线时间</label>
                        <!--时间格式化-->
                        <input class="form_date" id="system_start_time"
                               type="text" placeholder="开始时间" data-link-field="start_time" data-link-format="yyyy-mm-dd"
                               th:value="${#dates.format(projectData.system_start_time,'yyyy-MM-dd')}">
                    </div>
                    <!--安装位置-->
                    <div class="col-sm-12">
                        <label class="col-sm-4" style="text-align: right;">安装位置</label>
                        <input type="text" th:value="${projectData.system_address}">
                    </div>
                </fieldset>
                <!--分时电价表-->
                <fieldset class="col-xs-6" style="margin-right: 10px;">
                    <legend>分时电价表</legend>
                    <div style="margin-top: 10px;">
                        <table id="tuo_electricity_pricing" class="table table-condensed">
                        </table>
                    </div>
                </fieldset>
                <!--系统信息-->
                <fieldset>
                    <legend>系统信息</legend>
                    <!--本地监控管理软件版本号-->
                    <div class="col-sm-12">
                        <label class="col-sm-5" style="text-align: right;">本地监控管理软件版本号</label>
                        <input type="text">
                    </div>
                    <!--BMS厂家-->
                    <div class="col-sm-12">
                        <label class="col-sm-5" style="text-align: right;">BMS厂家</label>
                        <input type="text">
                    </div>
                    <!--电池供应商-->
                    <div class="col-sm-12">
                        <label class="col-sm-5" style="text-align: right;">电池供应商</label>
                        <input type="text">
                    </div>
                    <!--变流器供应商-->
                    <div class="col-sm-12">
                        <label class="col-sm-5" style="text-align: right;">变流器供应商</label>
                        <input type="text">
                    </div>
                    <!--项目图片-->
                    <div class="col-sm-12">
                        <label class="col-sm-5" style="text-align: right;">项目图片</label>
                        <input type="text">
                    </div>
                </fieldset>
                <div class="col-xs-12" style="text-align: center; margin-top: 10px;">
                    <button type="button" class="btn btn-primary btn-sm" id="save_change">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>